Skip to content

chore: Update GHActions to source go version from go.mod #889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gmfrasca
Copy link
Member

@gmfrasca gmfrasca commented Jun 26, 2025

Source the go version used in github actions dynamically from the repo go.mod file

Testing instructions

CI Passes

Checklist

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

Summary by CodeRabbit

  • Chores
    • Updated GitHub Actions workflows to use the latest version of the Go setup action.
    • Go version is now automatically detected from the project configuration file instead of being hardcoded.

@openshift-ci openshift-ci bot requested review from hbelmiro and VaniHaripriya June 26, 2025 20:01
Copy link

coderabbitai bot commented Jun 26, 2025

Walkthrough

The GitHub Actions workflows for functional, unit, integration, and nightly tests were updated to use actions/setup-go@v5 instead of older versions. The Go version is now dynamically determined from the go.mod file using the go-version-file input, replacing the previous fixed version string approach.

Changes

Files/Paths Change Summary
.github/workflows/functests.yml Updated to use actions/setup-go@v5 and dynamic Go version from go.mod.
.github/workflows/kind-integration.yml Upgraded actions/setup-go from v1 to v5, switched to dynamic Go version from go.mod.
.github/workflows/nightly_tests.yml Updated to actions/setup-go@v5, now reads Go version from go.mod.
.github/workflows/unittests.yml Updated to actions/setup-go@v5, now reads Go version from go.mod.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant Workflow YAML
    participant actions/setup-go
    participant go.mod

    GitHub Actions->>Workflow YAML: Trigger workflow
    Workflow YAML->>actions/setup-go: Setup Go (v5) with go-version-file
    actions/setup-go->>go.mod: Read Go version
    go.mod-->>actions/setup-go: Return version
    actions/setup-go-->>Workflow YAML: Go environment ready
    Workflow YAML->>GitHub Actions: Proceed with tests
Loading

Possibly related PRs

Suggested labels

approved, lgtm

Suggested reviewers

  • DharmitD
  • hbelmiro

Poem

Hopping through workflows, what do I see?
A shiny new Go, set up dynamically!
No more fixed strings, just read from the file,
Now running our tests with a modern style.
With every commit, CI hops with delight—
The pipelines are ready, the future is bright!
🐇✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (4)
.github/workflows/nightly_tests.yml (1)

12-15: Leverage built-in caching to speed up the nightly pipeline

actions/setup-go@v5 can cache the module download/build cache out-of-the-box. Enabling it on the long-running nightly job typically shaves several minutes off each run.

-        uses: actions/setup-go@v5
-        with:
-          go-version-file: go.mod
+        uses: actions/setup-go@v5
+        with:
+          go-version-file: go.mod
+          cache: true                # enable Go module cache
+          cache-dependency-path: go.sum

Make sure go.sum is at the repo root; otherwise adjust the path accordingly.

.github/workflows/functests.yml (1)

10-12: Enable the Go module cache for faster functional tests

The functional-test matrix rebuilds the binaries every PR, so cache hits pay back quickly.

-        uses: actions/setup-go@v5
-        with:
-          go-version-file: go.mod
+        uses: actions/setup-go@v5
+        with:
+          go-version-file: go.mod
+          cache: true
+          cache-dependency-path: go.sum
.github/workflows/unittests.yml (1)

10-12: Small tweak: add caching to the unit-test workflow

Same rationale as the other jobs—unit tests run on every push, so caching saves CI minutes and GitHub runner time.

-        uses: actions/setup-go@v5
-        with:
-          go-version-file: go.mod
+        uses: actions/setup-go@v5
+        with:
+          go-version-file: go.mod
+          cache: true
+          cache-dependency-path: go.sum
.github/workflows/kind-integration.yml (1)

43-46: Consider caching Go modules to speed up KinD integration tests

The KinD job is one of the slowest in the suite; module caching can materially shorten the “go mod download” phase.

-        uses: actions/setup-go@v5
-        with:
-          go-version-file: go.mod
+        uses: actions/setup-go@v5
+        with:
+          go-version-file: go.mod
+          cache: true
+          cache-dependency-path: go.sum
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c12fe06 and 4ada8a8.

📒 Files selected for processing (4)
  • .github/workflows/functests.yml (1 hunks)
  • .github/workflows/kind-integration.yml (1 hunks)
  • .github/workflows/nightly_tests.yml (1 hunks)
  • .github/workflows/unittests.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: dspo-tests
  • GitHub Check: precommit
  • GitHub Check: unittest
  • GitHub Check: functest

Copy link
Contributor

@mprahl mprahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/lgtm

Copy link
Contributor

openshift-ci bot commented Jun 27, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mprahl

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants